package com.bwie.conferenceroom.mapper;

import com.bwie.common.domain.ConferenceRoom;
import com.bwie.common.domain.Equipment;
import com.bwie.common.domain.request.ConferenceRoomReq;
import com.bwie.common.domain.request.SaveOrUpdConferenceRoomReq;
import com.bwie.common.domain.response.ConferenceRoomRes;
import com.bwie.common.domain.response.MeetingRoomAreaRes;
import com.bwie.common.domain.response.OccupationRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ConferenceRoomMapper {
    /**
     * 获取会议室列表
     * @param conferenceRoomReq
     * @return
     */
    List<ConferenceRoomRes> getConferenceRoomList(ConferenceRoomReq conferenceRoomReq);

    /**
     * 获取所有会议室设备
     * @return
     */
    List<Equipment> getEquipment();

    /**
     * 查询所有区域
     * @param pId
     * @return
     */
    List<MeetingRoomAreaRes> getAllMeetingRoomArea(@Param("pId") Integer pId);

    /**
     * 新建会议室
     * @param saveOrUpdConferenceRoomReq
     */
    void addConferenceRoom(SaveOrUpdConferenceRoomReq saveOrUpdConferenceRoomReq);

    /**
     * 新增会议室设备中间表
     * @param id
     * @param equipmentIds
     */
    void addConferenceRoomAndEquipment(@Param("conferenceRoomId") Integer id, @Param("equipmentIds") List<Integer> equipmentIds);

    /**
     * 根据id查询一条会议室信息
     * @param id
     * @return
     */
    ConferenceRoom selectConferenceRoomById(Integer id);

    /**
     * 根据会议室id查询会议室设备
     * @param id
     * @return
     */
    List<Integer> selectEquipmentIdsByConferenceRoomId(Integer id);

    /**
     * 根据Id查询会议室区域pid
     * @param meetingRoomAreaId
     * @return
     */
    Integer selectMeetingRoomAreaIdByPid(Integer meetingRoomAreaId);

    /**
     * 修改会议室
     * @param saveOrUpdConferenceRoomReq
     */
    void updConferenceRoom(SaveOrUpdConferenceRoomReq saveOrUpdConferenceRoomReq);

    /**
     * 根据会议室id删除会议室设备中间表
     * @param id
     */
    void delConferenceRoomAndEquipment(Integer id);

    /**
     * 获取占用会议室列表
     * @return
     */
    List<OccupationRes> getOccupationList();

}
